package com.ljs.myquartz;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

//项目启动时执行:
//@Component
public class MyStartupRunner implements CommandLineRunner {
    @Resource
    CronSchedulerJob cronSchedulerJob;
    @Override
    public void run(String... args) throws Exception {
        cronSchedulerJob.run1();//执行1
        cronSchedulerJob.run2();//执行2
        System.out.println(">>>>>>>>>>>>>>>定时任务开始执行<<<<<<<<<<<<<");
    }
}
